package carclockpack;

import java.util.Calendar;

public class MonthSetupState implements ClockSetupState {
    private ClockSetup clockSetup;
    private int month;
 
    public MonthSetupState(ClockSetup clockSetup) {
        this.clockSetup = clockSetup;
        month = Calendar.getInstance().get(Calendar.MONTH);
    }
 
    public void previousValue() {
        if (month > 0) {
            month--;
        }
    }
 
    public void nextValue() {
        if (month < 11) {
            month++;
        }
    }
 
    public void selectValue() {
        System.out.println("Month set to " + month);
        clockSetup.setState(clockSetup.getDaySetupState());
    }
 
    public String getInstructions() {
        return "Please set the month...";
    }
 
    public int getSelectedValue() {
        return month;
    }
}
